<?php

/*
	info: 获取活动详情
*/

define('NOT_HTMLPAGE', 'html');
define('IS_MEMBER_CHECK', TRUE);
require '../common.inc.php';

global_CheckPost(
	array(
		array('type','str','','',0,'content'),
));

$contentid = 1;
if ($webglobal['CPP']['type']=='preface')
{
	$contentid = 0;
}

$webglobal['CPP']['id'] = api_GetTopActivityID();
$webglobal['codeinfo'] = $db->GetOne("SELECT * FROM promotion_user WHERE pid='{$webglobal['CPP']['id']}' AND uid='{$user['m_uid']}'");
if (empty($webglobal['codeinfo']))
{
	api_EchoReturn($weblang['api_codeError']);
}

$webglobal['datainfo'] = $db->GetOne("SELECT * FROM promotion WHERE id='{$webglobal['CPP']['id']}'");

if (empty($webglobal['datainfo']))
{
	api_EchoReturn($weblang['api_notHaveActivity']);
}

$tempcontent = api_FormatContent($webglobal['datainfo']['content'], $webglobal['codeinfo']['codetime']);
echo $tempcontent[$contentid];
